package PlaneGame.CODE;
import java.awt.event.MouseEvent;

public abstract class GameButton extends GameImage{
    public GameButton(int width, int height, int x, int y, int imageNumber, String[] paths) {
        super(width, height, x, y, imageNumber, paths);
    }
    void mouseClick(MouseEvent e) {
        if(!on_off){
            return;
        }
        if(!this.contain(e.getX(),e.getY())){
            return;
        }
        clickEffect();
    }
    void mousePressed(MouseEvent e) {
        if(!on_off){
            return;
        }
        if(!this.contain(e.getX(),e.getY())){
            return;
        }
        pressEffect();
    }
    void mouseReleased(MouseEvent e) {
        if(!on_off){
            return;
        }
        if(!this.contain(e.getX(),e.getY())){
            return;
        }
        releaseEffect();
    }
    abstract void clickEffect();
    abstract void releaseEffect();
    abstract void pressEffect();
}
